package com.forum.model.pojo;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "section")
public class Section {
	
	@Id
	@Column(name = "name")
	private String name;
	
	@Column(name = "topiccount")
	private int topicCount;
	
	@Column(name = "postcount")
	private int postCount;
	
	@Column(name = "lasttopic")
	private Long lastTopic;
	
	@Column(name = "subforumname", nullable = false)
	private String subForumName;
	
	@Column(name = "description", nullable = false)
	private String description;
	
	@Transient
	private List<Topic> topics;
	
	public Section() {}
	
	public Section(String subForumName, String description) {
		this.subForumName = subForumName;
		this.description = description;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String getSubForumName() {
		return subForumName;
	}

	public void setSubForumName(String subForumName) {
		this.subForumName = subForumName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getTopicCount() {
		return topicCount;
	}

	public void setTopicCount(int topicCount) {
		this.topicCount = topicCount;
	}

	public int getPostCount() {
		return postCount;
	}

	public void setPostCount(int postCount) {
		this.postCount = postCount;
	}

	public Long getLastTopic() {
		return lastTopic;
	}

	public void setLastTopic(Long lastTopic) {
		this.lastTopic = lastTopic;
	}

	public List<Topic> getTopics() {
		return topics;
	}

	public void setTopics(List<Topic> topics) {
		this.topics = topics;
	}
}
